
#ifndef _DRIVER_KEY_SCAN_H
#define _DRIVER_KEY_SCAN_H

#include "stdint.h"


typedef enum
{
	KEY_NUM_1 = 0,
	KEY_NUM_2 = 1,
	KEY_NUM_3 = 2

}ENUM_KEY_NUM;


#define  KEY_STATUS_PRESS_NOT    0
#define  KEY_STATUS_PRESS_DOWN   1
#define  KEY_STATUS_PRESS_LONG   2


#define  KEY_HODL_CNT_THRE_X1    2
#define  KEY_HODL_CNT_THRE_X2    150

#define  KEY_LIFT_CNT_THRE       3
#define  KEY_LIFT_CNT_THRE_X2    6


#define  KEY_EVENT_X0   0x01
#define  KEY_EVENT_X1   0x02
#define  KEY_EVENT_X2   0x04
#define  KEY_EVENT_X3   0x08
#define  KEY_EVENT_X4   0x10
#define  KEY_EVENT_X5   0x20
#define  KEY_EVENT_X6   0x40

#define  KEY_EVENT_SWEEP         KEY_EVENT_X0
#define  KEY_EVENT_SWEEP_AREA    KEY_EVENT_X1
#define  KEY_EVENT_RECHARGE      KEY_EVENT_X2
#define  KEY_EVENT_POWER_ON      KEY_EVENT_X3
#define  KEY_EVENT_POWER_OFF     KEY_EVENT_X4
#define  KEY_EVENT_NET_SET       KEY_EVENT_X5

typedef struct
{
	uint8_t  status;
	uint16_t level;
	uint16_t holdcnt;
	uint16_t liftcnt;
	uint16_t checkprd;

}STR_KEY_SCAN;


extern void key_event_check(void);
extern void bumper_status_check(void);
extern void wheel_lift_check(void);
extern void charge_status_check(void);

#endif

